All problems from Colombian National Contest 2009 are solved!
[andmenj-acm.git] / 494 - Kindergarten Counting Game / 494.cpp
blob21ab5c46d85009b4bacff8490211ec2a74d3bf16
1 using namespace std;
2 #include <algorithm>
3 #include <iostream>
4 #include <iterator>
5 #include <numeric>
6 #include <sstream>
7 #include <fstream>
8 #include <cassert>
9 #include <climits>
10 #include <cstdlib>
11 #include <cstring>
12 #include <string>
13 #include <cstdio>
14 #include <vector>
15 #include <cmath>
16 #include <queue>
17 #include <deque>
18 #include <stack>
19 #include <list>
20 #include <map>
21 #include <set>
23 #define foreach(x, v) for (typeof (v).begin() x=(v).begin(); x !=(v).end(); ++x)
24 #define For(i, a, b) for (int i=(a); i<(b); ++i)
25 #define D(x) cout << #x " is " << x << endl
27 int main(){
28 string line;
29 while (getline(cin, line)) {
30 int cnt = 0;
31 int n = line.size();
32 for (int i = 0; i < n; ++i) {
33 if (isalpha(line[i])) {
34 cnt++;
35 while (i < n and isalpha(line[i])) i++;
36 i--;
39 printf("%d\n", cnt);
41 return 0;